package com.zy.dp.chainofresponsibility.example4;

public class ProjectManager2 extends ProjectManager
{
	public Object handleRequest(RequestModel rm)
	{
		if (PreFeeRequestModel.FEE_TYPE.equals(rm.getType()))
		{

			return myHandler(rm);
		}
		else
		{

			return super.handleRequest(rm);
		}
	}

	private Object myHandler(RequestModel rm)
	{

		PreFeeRequestModel frm = (PreFeeRequestModel) rm;

		if (frm.getFee() < 5000)
		{

			System.out.println("项目经理同意" + frm.getUser() + "预支差旅费用"
					+ frm.getFee() + "元的请求");
			return true;
		}
		else
		{

			if (this.successor != null)
			{
				return this.successor.handleRequest(rm);
			}
		}
		return false;
	}
}
